//
//  ZModel.m
//  WeClubs
//
//  Created by Zed Link on 10/4/2017.
//  Copyright © 2017 Zed. All rights reserved.
//

#import "ZModel.h"

@implementation ZModel

- (instancetype)initWithDictionary:(NSDictionary *)dictionary
{
    NSError *error;
    if (self = [super initWithDictionary:dictionary error:&error]) {
        if (error) {
            ZLog(@"Error: %@", error);
        }
    }
    return self;
}

+ (NSArray *)modeltForArr:(NSArray *)arr {
    
    NSMutableArray *mtbArr = [NSMutableArray array];
    for (NSDictionary *dict in arr) {
        
        ZModel * model = [[self alloc] initWithDictionary:dict];
        [mtbArr addObject:model];
    }
    return [mtbArr copy];
}


+ (JSONKeyMapper *)keyMapper
{
    // 设置下划线自动转驼峰
    return [JSONKeyMapper mapperForSnakeCase];
}

+(BOOL)propertyIsOptional:(NSString*)propertyName
{
    // 所有属性都可为nil
    return YES;
}

@end
